﻿using Miao;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
[Obsolete("被非泛型的特定typeof取代")]
public static class ContentFinder<T> where T : class
{
    public static T Get(string itemPath, bool reportFailure = true)
    {
        T val = null;

        if (typeof(T) == typeof(Texture2D))
        {
            val = (T)(object)Resources.Load<Texture2D>(MiaoFilePaths.ContentPath<Texture2D>() + itemPath);
        }
        if (typeof(T) == typeof(AudioClip))
        {
            val = (T)(object)Resources.Load<AudioClip>(MiaoFilePaths.ContentPath<AudioClip>() + itemPath);
        }
        if (val != null)
        {
            return val;
        }
        
        return null;
    }
}

